﻿/**
 * 
 * @file FITKSEAAbstractJounction.h
 * @brief Joint抽象类与管理器声明
 * @author LiBaojun (libaojunqd@foxmail.com)
 * @date 2024-11-06
 * 
 */
#ifndef _FITK_ABSTRACT_SEA_JOINT_H___
#define _FITK_ABSTRACT_SEA_JOINT_H___
 
#include "FITKAbstractJunction.h"

namespace Acoustics
{
    /**
     * @brief  用户自定义连接数据信息
     * @author BaGuijun (baguijun@163.com)
     * @date   2024-11-11
     */
    struct FITKSEAJunUserDefStr
    {
        //子系统1ID
        int _subsysRowID = -1;
        //子系统2ID
        int _subsysColumnID = -1;
        //子系统1索引（例如：Plate-E = 0；Plate-S = 1；Plate-F = 2）
        int _subsysRowIndex = 0;
        //子系统2索引（例如：Plate-E = 0；Plate-S = 1；Plate-F = 2）
        int _subsysColumnIndex = 0;
        /**
         * @brief  频谱id
         *         -2：Analytical
         *         -1：Reciprocal
         *         其余：自定义频谱id
         * @author BaGuijun (baguijun@163.com)
         * @date   2024-11-11
         */
        int _spectrumID = -2;
        //ui中X轴
        int _rowIndex = 1;
        //ui中Y轴
        int _columnIndex = 1;
    };
    /**
     * @brief 耦合抽象基类
     * @author LiBaojun (libaojunqd@foxmail.com)
     * @date 2024-11-06
     */
    class FITKAcousticsModelAPI FITKSEAAbstractJunction : 
        public FITKAbstractJunction
    {
        Q_OBJECT
    public:
        /**
         * @brief Construct a new FITKSEAAbstractJoint object
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-11-06
         */
        explicit FITKSEAAbstractJunction() = default;
        /**
         * @brief Destroy the FITKSEAAbstractJoint object
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-11-06
         */
        virtual ~FITKSEAAbstractJunction();
        /**
         * @brief    添加自定义信息
         * @param[i] connection    自定义信息
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-11
         */
        void appendUserDef(FITKSEAJunUserDefStr& userDef);
        /**
         * @brief    替换所有自定义信息
         * @param[i] connections   自定义信息
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-11
         */
        void replaceUserDefs(QList<FITKSEAJunUserDefStr>& userDefs);
        /**
         * @brief    获取所有自定义信息
         * @return   QList<FITKSEAJunPointStr>    所有自定义信息
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-11
         */
        QList<FITKSEAJunUserDefStr> getUserDefs();
        /**
         * @brief    获取对称矩阵
         * @return   QString     对称矩阵类型
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-13
         */
        QString getMatrixForm();
        /**
         * @brief    设置对称矩阵类型
         * @param[i] type       
         * @return   void
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-13
         */
        void setMatrixForm(QString type);

    protected:
        /**
         * @brief    初始化user-define矩阵
         * @param[i] subSusIDList      子系统ID列表
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-19
         */
        void initUserDefineMatrix(QList<int>& subSysIdList);

    protected:
        /**
         * @brief  是否启用连接
         * @author BaGuijun (baguijun@163.com)
         * @date   2024-11-11
         */
        bool _enabledJunction = true;
        /**
         * @brief  用户自定义信息
         * @author BaGuijun (baguijun@163.com)
         * @date   2024-11-11
         */
        QList<FITKSEAJunUserDefStr> _userDefs = {};
        /**
         * @brief  对称矩阵
         * @author BaGuijun (baguijun@163.com)
         * @date   2024-11-13
         */
        QString _matrixForm = "Symmetric";
    private:
    };

}

#endif